package com.springboot.demo.controller;

import com.springboot.demo.domain.Dictionary;
import com.springboot.demo.service.DictionaryService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("dictionary")
public class DictionaryController {
    @Resource
    private DictionaryService dictionaryService;

    @ApiOperation(value = "getDictionary 获取字典数据")
    @GetMapping("/get/{code}/{parentCode}")
    @ResponseBody
    public Dictionary getDictionary(@PathVariable String code, @PathVariable String parentCode) {
        return dictionaryService.findDictionaryByDictionaryCodeAndParentDictionaryCode(code, parentCode);
    }
}
